<?php

namespace Togetwzb\Yii2\Aliyun\Oss;

use OSS\OssClient;

/**
 * Oss 扩展库
 */
class OssHelper
{
    /**
     * @param OssConfig $config
     * @return OssClient
     */
    public static function getClient($config)
    {
        return new OssClient((array)$config);
    }

    /**
     * @param $accessKeyId
     * @param $accessKeySecret
     * @param $endpoint
     * @param $isCName
     * @param $securityToken
     * @param $requestProxy
     * @return OssClient
     */
    public static function getClientBy($accessKeyId, $accessKeySecret, $endpoint, $isCName = false, $securityToken = NULL, $requestProxy = NULL)
    {
        return new OssClient($accessKeyId, $accessKeySecret, $endpoint, $isCName, $securityToken, $requestProxy);
    }
}